package com.tanhua.manager.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.manager.domain.AnalysisByDay;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AnalysisByDayMapper extends BaseMapper<AnalysisByDay> {
    /**
     * 查询累计用户数
     * @return 累计用户数
     */
    @Select("SELECT SUM(num_registered) FROM tb_analysis_by_day")
    Long queryCumulativeUsers();

    @Select("SELECT SUM(num_active) FROM tb_analysis_by_day WHERE record_date BETWEEN #{start} AND #{end}")
    Long queryActiveUsers(@Param("start") String startDate,@Param("end") String endDate);
}
